let obj = {
    name: "zs",
    age: 16,
    address: { city: "beijing", street: "xueyuan", c: { d: "dd" } },
    arr: [
        [4, 22, 3, { obj: 1 }]
    ],
};

/* 深拷贝 */
function deepCopy(obj) {
    if (obj == null || typeof obj != "object") {
        return obj;
    }
    let result;
    if (obj instanceof Array) {
        result = [];
    } else {
        result = {};
    }
    for (let key in obj) {
        if (obj.hasOwnProperty(key)) {
            result[key] = deepCopy(obj[key]);
        }
    }
    return result;
}
let res1 = deepCopy(obj);

console.log(res1.address.c === obj.address.c);